<template>
  <div>
    <a-modal
      title="添加产品"
      width="80%"
      :visible="visible"
      :destroyOnClose="true"
      @ok="confirm"
      @cancel="cancel"
    >
      <pro-table ref="proTable" @ok="handleOk"/>
    </a-modal>
  </div>
</template>
<script>
import proTable from './proIndex.vue'
export default {
  name: 'BomlanComp',
  components: {
      proTable
    },
  data() {
    return {
      // 是否可见
      visible: false
    }
  },
  inject: ['getProList'],
  methods: {
    open() {
      this.visible = true
    },
    confirm() {
      this.getProList()
      this.$emit('confirm', this.$refs.proTable.getSelectedRows())
      this.visible = false
    },
    cancel() {
      this.getProList()
      this.visible = false
    },
    handleOk() {
      this.$emit('ok')
    }
  }
}
</script>
<style lang = "less">
  .table-operator {
    margin-bottom: 18px;
  }
  button {
    margin-right: 8px;
  }
  /*滚动条样式*/
  ::-webkit-scrollbar {
    width: 5px;
    height: 5px;
  }
  /*定义滑块*/
  ::-webkit-scrollbar-thumb {
    border-radius: 10px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    background: #a9a9a9;
  }
  /*滑动轨道*/
  ::-webkit-scrollbar-track {
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    background: #f5f5f5;
  }
  </style>
